import com.mitbbs.util.firefox

LOGIN_URL = 'http://www.mitbbs.com/newindex/mitbbs_bbslogin.php'
LOGOUT_URL = 'http://www.mitbbs.com/newindex/mitbbs_bbslogout.php'

def login(browser, user, passwd):
  data = "id=%s&login.x=20&login.y=12&passwd=%s" % (user, passwd)
  browser.open_url(LOGIN_URL, data)
    
def logout(browser):
  browser.open_url(LOGOUT_URL)
    
if __name__ == '__main__':
  browser = com.mitbbs.util.firefox.Firefox()
  login(browser, '', '')
  browser.print_cookie()